home *** CD-ROM | disk | FTP | other *** search
/ Virtual Top Model / Virtual Top Model - Disc 1.iso / modulos / intro.dxr / 00067_BuscaCd.ls < prev    next >
Encoding:
Text File  |  1997-04-02  |  2.7 KB  |  87 lines

  1. on BuscaCd
  2.   global nIdioma, Unidad, NumCd, sPathIni, bDebug
  3.   set CD to char 1 to 1 of Unidad
  4.   openXLib(sPathIni & "dllglue")
  5.   set gBox to dllglue(mnew, "USER.EXE", "MessageBox", "I", "WSSW")
  6.   case nIdioma of
  7.     1:
  8.       set Mensaje to "Introduzca el CD-ROM " & NumCd
  9.       set MensErr to "Un problema serio a ocurrido. La aplicaci├│n se terminar├í."
  10.     2:
  11.       set Mensaje to "Ins├⌐rer le CD-ROM " & NumCd
  12.       set MensErr to "Un probl├¿me grave vient de se produire. L' application se fermer├í."
  13.     3:
  14.       set Mensaje to "Insert CD-ROM " & NumCd
  15.       set MensErr to "A serious error has occured. Application terminating."
  16.   end case
  17.   openXLib(sPathIni & "fileio")
  18.   if Unidad <> EMPTY then
  19.     set Tentativas to 1
  20.     repeat while Tentativas <= 2
  21.       if NumCd = 1 then
  22.         set Fichero to fileio(mnew, "read", CD & ":\VTM\MOD-1.DXR")
  23.       else
  24.         set Fichero to fileio(mnew, "read", CD & ":\VTM\MOD-5.DXR")
  25.       end if
  26.       if objectp(Fichero) then
  27.         gBox(mdispose)
  28.         closeXLib(sPathIni & "dllglue")
  29.         Fichero(mdispose)
  30.         closeXLib(sPathIni & "fileio")
  31.         return CD & ":"
  32.       else
  33.         set result to gBox(mCall, 0, Mensaje, EMPTY, 33)
  34.         if result = 2 then
  35.           gBox(mdispose)
  36.           closeXLib(sPathIni & "dllglue")
  37.           closeXLib(sPathIni & "fileio")
  38.           return EMPTY
  39.         end if
  40.       end if
  41.       set Tentativas to 2
  42.     end repeat
  43.     if objectp(Fichero) then
  44.       Fichero(mdispose)
  45.     end if
  46.   end if
  47.   if bDebug then
  48.     set Lista to ["C", "D", "E", "F"]
  49.   else
  50.     set Lista to []
  51.     set gdriveList to ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
  52.     set gdriveType to dllglue(mnew, "KRNL386.EXE", "GetDriveType", "W", "I")
  53.     set result to 0
  54.     repeat with x = 0 to 25
  55.       set result to gdriveType(mCall, x)
  56.       if result = 4 then
  57.         add(Lista, getAt(gdriveList, x + 1))
  58.       end if
  59.     end repeat
  60.     gdriveType(mdispose)
  61.   end if
  62.   repeat while 1
  63.     repeat with x = 1 to count(Lista)
  64.       set CD to getAt(Lista, x)
  65.       if NumCd = 1 then
  66.         set Fichero to fileio(mnew, "read", CD & ":\MODULOS\MOD-1.DXR")
  67.       else
  68.         set Fichero to fileio(mnew, "read", CD & ":\MODULOS\MOD-5.DXR")
  69.       end if
  70.       if objectp(Fichero) then
  71.         gBox(mdispose)
  72.         closeXLib(sPathIni & "dllglue")
  73.         Fichero(mdispose)
  74.         closeXLib(sPathIni & "fileio")
  75.         return CD & ":"
  76.       end if
  77.     end repeat
  78.     set result to gBox(mCall, 0, Mensaje, EMPTY, 33)
  79.     if result = 2 then
  80.       gBox(mdispose)
  81.       closeXLib(sPathIni & "dllglue")
  82.       closeXLib(sPathIni & "fileio")
  83.       return EMPTY
  84.     end if
  85.   end repeat
  86. end
  87.